﻿using System;
using System.Collections.Generic;

using System.Web;

/// <summary>
/// Summary description for B_PurchaseOrder
/// </summary>
namespace Bestlife.ERP.BusinessRules
{
    public class B_PurchaseOrder
    {
        public B_PurchaseOrder()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static Bestlife.ERP.Entities.E_PurchaseOrder getprice(string proname)
    {
        return Bestlife.ERP.DataAccess.D_PurchaseOrder.getprice(proname);
    }

        public static decimal linetot(decimal qty, decimal unitval)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.linetotal(qty, unitval);
        }

        public static Boolean insert(Bestlife.ERP.Entities.E_PurchaseOrder order,string user)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.insert(order,user);
        }

        public static Boolean insertorder(Bestlife.ERP.Entities.E_PurchaseOrder order,string user)
        {
            return Bestlife.ERP.DataAccess.D_ApproveGRN.updateorder(order,user);
        }

        public static Boolean insertsupp(Bestlife.ERP.Entities.E_PurchaseOrder supp,string user)
        {
           return Bestlife.ERP.DataAccess.D_PurchaseOrder.insertsupporder(supp, user);
        }

        public static Boolean total(Bestlife.ERP.Entities.E_PurchaseOrder tot, string user)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.total(tot, user);
        }

        public static Boolean approval(Bestlife.ERP.Entities.E_GRN grn ,string approval, string user,int itemcount)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.approveorder(grn, approval, user, itemcount);
        }
        public static Boolean allapprove(List<Bestlife.ERP.Entities.E_GRN> grn,string user, string approve,int itemcount)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.allapproved(grn,user, approve,itemcount);
        }
        public static Boolean approvalPO(Bestlife.ERP.Entities.E_PurchaseOrder approval, string user)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.approvePO(approval, user);
        }
       

        public static List<string> stockid(string proid)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.stockid(proid);
        }
        public static Bestlife.ERP.Entities.product setalldata(string proid)
        {
          return Bestlife.ERP.DataAccess.D_PurchaseOrder.setalldata(proid);
        }

        public static int getlastGRN()
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.lastGRNid();
        }

        public static int laststockid()
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.laststockid();
        }

        public static decimal lastcode(string proid)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.lastcode(proid);
        }

        public static string getproname(string proid)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.getproname(proid);
        }
        public static string getproid(string proname)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.getproid(proname);
        }
        public static int getsupid(string supname)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.getsupid(supname);
        }
        public static Boolean approval(List<Bestlife.ERP.Entities.E_GRN> grn, string approval, string user, int itemcount)
        {
            return Bestlife.ERP.DataAccess.D_PurchaseOrder.approveorder(grn, approval, user, itemcount);
        }

      

    }
}